<%@page import="java.util.Date"%>
<script type="text/javascript" src="js/jquery-1.7.2.min.js"></script>
<script type="text/javascript" src="js/jquery.SuperSlide.2.1.1.js"></script>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@ page language="java" contentType="text/html; charset=utf-8"
	pageEncoding="utf-8"%>
<script>
var s = false;
function qqq(num2){
	var carttypeg = $("#carttypega").val();
	var sid = $("#sid").val();
	var num = $("#num").val();
	var cart_img = $("#cart_img").val();
	var tot = 0;
	var count=0;
	var totpri=0;
	if(cart_img==""){
		alert("请选择颜色")
		s=true;
		return false;
	}
	$.get("addCart.shtml",{"hid":num2,"carttypeg":carttypeg,"sid":sid,"num":num,"cart_img":cart_img}, function(data) {
		$.each(data, function() {
			var cart = "<div class='card_style_two clear'><div class='left'><img src='"+this.cartimg+"' width='50px' style='margin-right:5px;' /></div><div class='left card_style_three'><p>"+this.cartname+"</p><p><span>"+this.cart_typeg+"</span><span>×</span><span>"+this.cartnum+"</span><span style='margin-left: 10px;'>价格</span><span style='color: red'>￥"+this.cartprice+"</span></p></div><div class='left card_style_four'>*</div></div>";
			$(".card_style_one").append(cart);
			totpri = totpri+(parseInt(this.cartnum)*parseFloat(this.cartprice))
		})
	 $("#cart-totp").html(totpri.toFixed(2));
	})

}
function qqq2(num3){
	/* var carttypeg = $("#carttypega").val();
	var sid = $("#sid").val();
	var num = $("#num").val();
	var cart_img = $("#cart_img").val(); */
	var tot = 0;
	var count=0;
	var totpri=0;
	/* if(cart_img==""){
		alert("请选择颜色")
		s=true;
		return false;
	} */
	$.get("addCart.shtml",{"hid":num3}, function(data) {
		$.each(data, function() {
			var cart = "<div class='card_style_two clear'><div class='left'><img src='"+this.cartimg+"' width='50px' style='margin-right:5px;' /></div><div class='left card_style_three'><p>"+this.cartname+"</p><p><span>"+this.cart_typeg+"</span><span>×</span><span>"+this.cartnum+"</span><span style='margin-left: 10px;'>价格</span><span style='color: red'>￥"+this.cartprice+"</span></p></div><div class='left card_style_four'>*</div></div>";
			$(".card_style_one").append(cart);
			totpri = totpri+(parseInt(this.cartnum)*parseFloat(this.cartprice))
		})
	 $("#cart-totp").html(totpri.toFixed(2));
	})

}
	function one(num) {
		$(".header_style_three").css("display","block");
		$("#header_style_one").empty();
		$.post("header.shtml", {
			Yid : num
		}, function(data) {
			$.each(data, function() {
			var header = "<div class='header_style_two'><p><img src='images/index/"+this.zimg+"'/></p><p>"+this.zName+"</p></div>";
			$("#header_style_one").append(header);		
			})
		})
	}
	function two() {
		$(".header_style_three").css("display","none");
	}
	var index = 0;
	$(function() {
		
		var url= window.location.href;
	   var url2 =url.substring(30);
	   $("#address").val(url2);
	   /* alert(url3); */
/* 	 	$("#logout").attr("href",url3+"?dizhi="+url2) */
	
		
		
		$(".header").mouseover(function(){
			$(this).css({"color":"#b7ae15","font-weight":"bold","text-shadow":"1px 1px 1px #004000"});
		})
		$(".header").click(function(){
			$(this).css({"color":"#b7ae15","font-weight":"bold","text-shadow":"1px 1px 1px #004000"});
		})
		$(".header").mouseout(function(){
			index = $(this).index(".header");
			$(".header").css({"color":"#000040","font-weight":"normal","text-shadow":"none"});
		})
		$(".header_style_three").mouseover(function(){
			$(this).css("display","block");
		 	$(".header").eq(index).css({"color":"#b7ae15","font-weight":"bold","text-shadow":"1px 1px 1px #004000"});
		})
		
		$(".header_style_three").mouseout(function(){
			$(this).css("display","none");
		 	$(".header").css({"color":"#000040","font-weight":"normal","text-shadow":"none"});
		})
		
			$(".goumai001").click(function(){
					$("#goumai").fadeIn(300);
					setTimeout(function(){
						$("#goumai003").show(400);
					}, 250)
				}
				)
				$("#loginClose").click(function(){
					$("#goumai003").fadeOut(250);
					setTimeout(function(){
						$("#goumai").slideUp(240);
					}, 240)
				})
				$("#login").click(function(){
					$("#goumai").fadeIn(300);
					setTimeout(function(){
						$("#goumai003").show(400);
					}, 250)
					
				})
				
				$(".add_card").click(function(){
					s=false;
					$(".card_style_one").empty();
					qqq(0);
					if(s==true){
						alert("sdf")
						return;
					}
					$(".pppp").slideDown(300);
					setTimeout(function(){
						$(".pppp").slideUp(300);
					}, 1000)
				
				
				
				})
				
				$(".cart001").mouseenter(function(){
					/* alert("Sdf") */
					s=false;
					$(".card_style_one").empty();
					qqq2(0);
					if(s==true){
						alert("sdf")
						return;
					}
					$(".pppp").slideDown(300);
				
					
				})
				$(".cart001").mouseleave(function(){
						$(".pppp").slideUp(100);
				})
				$(".cart001").click(function(){
					location.href="shoppingCart.shtml";
				})
				
				$("#logins").click(function(){
					$("#form5").trigger("submit");
				})
				var geren = "${user.namesp}";
				$("#geren").click(function(){
				if(geren != ""){
					location.href="frontDeskManager/frontDeskIndex.shtml";
				}else{
					alert('请登录');
				}
				})
				
				$(".login001").click(function(){
					location.href="index.html";
				})
				var headerpd = false;
				$("#soushop").focus(function(){
					$("#headershopName").empty();
					$.post("headergoods.shtml",function(data){
						$.each(data,function(){
							var headerli = "<li class='soushop002' style='padding-left:8px;box-sizing:border-box;' data='"+this.sid+"'>"+this.shopname+"</li>";
							$("#headershopName").append(headerli);
						})
					})
					$(".soushop001").slideDown(100);
				})
				
				$("#soushop").keyup(function(){
					$("#headershopName").empty();
					var headershopname =$(this).val();
					$.post("headergoods.shtml",{"headershopname":headershopname},function(data){
						$.each(data,function(){
							var headerli = "<li class='soushop002' style='padding-left:8px;box-sizing:border-box;' data='"+this.sid+"'>"+this.shopname+"</li>";
							$("#headershopName").append(headerli);
						})
					})
				})
				
				
				
				/* $(".soushop002").click(function(){
					
				}) */
		 	
				
				 $("body").on('mouseover','.soushop002',function(){
					 $(this).css("background-color","#D8CEBC");
					$(this).siblings().css("background-color","white");
					$(".soushop001").css("display","block");
    			})
				 $("body").on('click','.soushop002',function(){
					var headershopname =$(this).attr("data");
					location.href="good-details.shtml?headershopname="+headershopname; 
					$(".soushop001").slideUp(100);
    			})
						$("#soushop").blur(function(){
							var headertime = setInterval(function(){
								if(headerpd!=true){
									$(".soushop001").slideUp(100);
									clearInterval(headertime);
								}
							},100)
						
				})

			
				
			
	})
	
</script>
<link rel="stylesheet"
	href="css/Header.css?id=<%=new Date().getTime()%>" />


<div id="goumai">
	<form action="login.shtml" id="form5">
		
		<div
			style="width: 320px; background-color: white; height: 320px; margin: 160px auto; display: none; padding-top: 40px; box-sizing: border-box; letter-spacing: 0.5em; box-shadow: -1px 2px 15px rgba(20, 20, 58, 1); position: relative;"
			id="goumai003">
			<input type="hidden" id="address" name="address" />
			<div>
				<span style="font-size: 16px; color: #e5c182; margin-left: 60px;">账户登录</span><span
					style="font-size: 16px; margin-left: 10px;">‖</span> <span
					style="font-size: 16px; color: #999;">邮箱登录</span> <span
					style="margin-left: 10px; position: absolute; top: 20px; right: 15px;"
					id="loginClose">关闭</span>
			</div>
			<div style="margin-left: 55px; margin-top: 30px;" class="clear">
				<p class="clear">
					<span class="left"
						style="display: block; width: 25px; height: 24px; background-color: whtie; border: 1px solid #cdcdcd; text-align: center;"><img
						src="images/index/yhm.png" style="margin-top: 3px;" /></span><span
						class="left" style="display: block;"><input type="text"
						name="yhm" id="yhm"
						style="width: 180px; height: 24px; border-left: none; border-top: 1px solid #cdcdcd; border-right: 1px solid #cdcdcd; border-bottom: 1px solid #cdcdcd;" /></span>
				</p>
				<p class="clear" style="margin-top: 20px;">
					<span class="left"
						style="display: block; width: 25px; height: 24px; background-color: whtie; border: 1px solid #cdcdcd; text-align: center;"><img
						src="images/index/mm.png" style="width: 20px; margin-top: 1px;" /></span><span
						class="left" style="display: block;"><input type="password"
						name="mm" id="mm"
						style="width: 180px; height: 24px; border-left: none; border-top: 1px solid #cdcdcd; border-right: 1px solid #cdcdcd; border-bottom: 1px solid #cdcdcd;" /></span>
				</p>
			</div>
			<div
				style="margin-left: 55px; margin-top: 25px; border: 1px solid #8c6e3a; font-size: 16px; box-shadow: -1px 2px 6px rgba(0, 0, 0, 0.7); color: white; background-color: #a47f3e; width: 208px; text-align: center; height: 35px; line-height: 35px; border-radius: 2px;"
				id="logins">登录</div>
			<div style="margin-top: 30px;">
				<img src="images/index/login_last.gif" width="320px" />
			</div>
		</div>
	</form>
</div>
<div style="background-color: #333333; width: 100%">
	<div
		style="width: 960px; margin: 0 auto; height: 30px; line-height: 30px; color: white"
		class="clear">
		<div class="left">
			<span style="margin-left: 30px;">好的生活，没那么贵</span><span></span>
		</div>
		<div class="right" style="margin-left:10px;margin-right:30px;">
		<span
				style="margin-left: 15px;">
				<img src="images/index/login.png" width="20px" class="cart001" style="margin-top:6px;" />
			</span>
		</div>
		<div class="right header-one">
			<c:if test="${empty user.namesp}">
				<span id="login">登录</span>
			</c:if>
			<span>注册</span> <span>我的订单</span> <span>会员</span>
			<span>客户服务</span> <span>||</span> <span>APP</span>
		</div>
		
		<div class="right header-one">
			<c:if test="${not empty user.namesp}">
				<span>欢迎：</span>
				<span><img src="images/index/header001.gif"
					style="margin-left: -10px; margin-top: 6px;" /></span>
				<span style="margin-left: 10px; color: #c2a36d">${user.namesp }
				</span>
				<span id="geren">个人中心</span>
				<a href="logout.shtml" onclick="return confirm('确定要注销吗')"
					style="margin-left: 15px;color:#c2a36d" id="logout"> 注销 </a>
			</c:if>
		</div>
	</div>
</div>

<div id="style_shouye" style="z-index: 10000" class="clear">
	<div id="style_width_two" style="z-index: 10000" class="clear">
		<div style="margin-top: 20px; float: left; margin-left: 350px;">
			<img src="images/index/login001.gif" width="300" class="login001" />
		</div>
		<div
			style="float: left; margin-right: 20px; margin-top: 70px; margin-left: 20px; position: relative;"
			class="clear">
			<div class="soushop001" style="width:173px;display:none;line-height:18px;z-index:10000000;padding-top:4px;padding-bottom:10px;box-sizing:border-box;border:1px solid #c4c4c4;border-top:none;background-color:rgba(255,255,255,1);position:absolute;top:19px;left:0px;">
			<ul id="headershopName">
			
			</ul>
			</div>
			<span style="display: block; float: left">
			<input type="text" name="soushop" id="soushop" style="width: 170px; height: 15px;" />
			</span> 
			<span style="margin-right:10px;margin-left:20px;float:left;width:50px;height:20px;line-height:20px;background-color:#eee;box-shadow:1px 1px 2px rgba(0,0,0,0.5);text-align:center;">
				搜索
			</span>
				<span
				style="display: block; float: left"></span> 
			<%-- 	<span
				style="display: block; position: absolute; top: -18px; right: -10px; width: 25px; height: 25px; text-align: center; background-color: rgba(161, 22, 78, 0.9); border-radius: 50%; line-height: 25px; color: white">${card_num }</span> --%>
			<div style="z-index:100000;display:none;width:320px;height:280px;position: absolute; right: -240px; top: -70px; " class="pppp">
			<div class="card_style_one"
				style="width: 320px; z-index:1000000;height: 270px;max-height:240px;overflow:auto; box-shadow: 2px 2px 15px rgba(200, 200, 200, 0.8); background-color: white;">

			</div>
			<div class="card_totPrices"
				style="width: 320px; z-index:1000000;height: 40px; background-color: #a9936e; line-height: 40px;">
				<span style="margin-left: 180px; font-size: 14px;">总价:</span><span>￥
				</span><span style="color: red; font-size: 14px;" id="cart-totp">0</span>
			</div>
			</div>
		</div>
	</div>
	<div id="style_width_one" style="z-index: 10000">
		<div id="style_header_one" style="z-index: 10000">
			<c:forEach items="${list }" var="zhuti">
				<span><a href="clothing.shtml?zhutiId=${zhuti.yid }"
					class="header" onmouseover="one(${zhuti.yid})"
					onmouseout="two()" style="z-index: 10000">${zhuti.name }</a></span>
			</c:forEach>
		</div>
	</div>
</div>
<div class="header_style_three clear">
	<div id="header_style_one" class="clear"></div>
</div>

